package com.charlotte.study.gupao.state.gper;

/**
 * @author junjie.ding
 * @date 2020/3/20
 */
public class UnLoginState extends UserState {
    @Override
    protected void favorite() {
        switch2Login();
        this.context.favorite();
    }

    @Override
    protected void comment(String comment) {
        switch2Login();
        this.context.comment(comment);
    }

    private void switch2Login(){
        System.out.println("未登录，跳转到登录页面登录");
        this.context.setCurrentState(this.context.LOGIN_STATE);
    }
}
